CREATE SEQUENCE S_PAGO_PRES;

--------------------------------------------------------
--  DDL for Trigger AI_PAGO_PREST
--------------------------------------------------------

  CREATE OR REPLACE TRIGGER "UTN_LABV"."AI_PAGO_PREST" 
   before insert on "UTN_LABV"."PAGO_PRESTAMOS" 
   for each row 
begin  
   if inserting then 
      if :NEW."ID_PAGO" is null then 
         select S_PAGO_PRES.nextval into :NEW."ID_PAGO" from dual; 
      end if; 
   end if; 
end;

/
ALTER TRIGGER "UTN_LABV"."AI_PAGO_PREST" ENABLE;
